package com.qeegoo.b2bautozityp.injector.module;

import android.support.v7.widget.LinearLayoutManager;

import com.qeegoo.b2bautozityp.api.RequestApi;
import com.qeegoo.b2bautozityp.injector.PerFragment;
import com.qeegoo.b2bautozityp.moudle.base.LazyLoadFragment;
import com.qeegoo.b2bautozityp.moudle.goods.viewmodel.GoodsManagerViewModel;
import com.qeegoo.b2bautozityp.moudle.inquiry.viewmodel.InquiryListViewModel;

import dagger.Module;
import dagger.Provides;

/**
 * 王少岩 在 2017/9/13 创建了它
 */

@Module
public class InquiryListFragmentModule {

    @Provides
    @PerFragment
    public LinearLayoutManager provideLinearLayoutManager(LazyLoadFragment fragment) {
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(fragment.getContext());
        return linearLayoutManager;
    }



    private final LazyLoadFragment mFragment;

    public InquiryListFragmentModule(LazyLoadFragment fragment) {

        mFragment = fragment;
    }


    @Provides
    LazyLoadFragment getFragment() {
        return mFragment;
    }


    @Provides
    @PerFragment
    public InquiryListViewModel provideModel(RequestApi api) {

        return new InquiryListViewModel(api);
    }


    @Provides
    @PerFragment
    public GoodsManagerViewModel provideModel1(RequestApi api) {

        return new GoodsManagerViewModel(api);
    }


}
